package com.echo.dao;

import com.echo.entity.pojo.Assessment;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author ATSELI
 * @version 1.0
 * @date 2021/7/18 11:39
 */

@Mapper
public interface AssessmentDao {

    @Insert("Insert into assessment values(#{assessment.id}, " +
            "#{assessment.userId}, #{assessment.username}, #{assessment.grade}, " +
            "#{assessment.academy}, #{assessment.profession}, #{assessment.classNumber}, " +
            "#{assessment.name}, #{assessment.applicationStatus})")
    int add(@Param("assessment") Assessment assessment);


    @Select("select * from assessment where user_id = #{id}")
    Assessment checkUser(@Param("id") Integer id);
}
